<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<!--<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">-->
<title>选择用户</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

<jsp:include page="../common/import.jsp"></jsp:include>

</head>

<div class="modal-bg-white">
                
            <div class="modal-body">        
                <div class="search-head">
                    <div class="search-title">查询条件</div>
                    <div class="modal-open"><span class="font12">展开</span><i class="fa fa-angle-down ml5"></i></div>
                </div>
                <form id="_query_form" onSubmit="return false;" >
                <ul class="ser_ul modal-input-ul" style="display:none;">
				  
                    <li style="width:50%;">
                    <label class="ser_tit">机构：</label> 
					<input type="text" class="inputText modal-input" id="s_unitName" name="unitName" value="" readOnly/>
					<input id="s_unitId" name="unitId" hidden="hidden" value="" type="text">	
					
                    </li>
                    <li style="width:50%;">
                       <label class="ser_tit">用户名：</label>
                       <input type="text" class="inputText modal-input" id="s_userName" name="userName" value="" />
						
                    </li>

                </ul>
			</form>   
                <div id="table-papination">
                
                </div>
              
            </div>
</div>

<div id="treediv" style='overflow-y:scroll;overflow-x:auto;display:none; position:absolute;width:250px;height:200px;background-color:#fff; border:1px solid #BEC0BF;padding:5px;font-size:12px;'>
	
	<ul id="tree" class="ztree"></ul>
</div>




</body>
<script type="text/javascript">

//pageContentDiv = '#table-papination';
queryUrl = '${ctx}/myapp/query/user';


$(function(){
	$("#s_unitName").focus(function() {
		var divObj = $("#treediv");
    	var txtObj = $("#s_unitName");
    	showDiv(divObj,txtObj,unitsetting,"${ctx}/user/getUnit");
    	
	});
	
	
	//changePage('${ctx}/myapp/query/user/table','#_query_form','1','${pageBean.pageSize }',0)
	jumpPage(1,'',true);
	
	/* 搜素条件收起和展开 */
	var count = 0;
    $(".modal-open").click(function(){
        count++;
        var i = count%2;
        if(i == 1 ){
            $(".modal-input-ul").slideDown();
            $(".modal-open").text('收起').append('<i class="fa fa-angle-up ml5"></i>');
        }
        if(i == 0 ){
            $(".modal-input-ul").slideUp();
            $(".modal-open").text('展开').append('<i class="fa fa-angle-down ml5"></i>');
        }
    });
});

//在选择用户的弹出层那使用的
function showUnitDivOnUserSelect(divobj, obj, zsetting, url) {
	$.post(url, function(data2) {
		$.fn.zTree.init($("#tree"), zsetting, data2);
		$(divobj).css("left", $(obj).offset().left );
		$(divobj).css("top", $(obj).offset().top+$(obj).height()+2);
		$(divobj).show();
	},'json');
}

//确定用户
function comfireUser(){
	//alert('1');
	var user = $("#_userTableRadio tbody tr td input[name='_userId']:checked").val();
	//alert(user);
	if(user != null && user != '' && user != undefined ){
		var _user = user.split("_");
		window.parent.setUserValue(_user[0],_user[1]);
	}
//	setInterval("parent.layer.close(parent.layer.getFrameIndex(window.name))",100);
    parent.layer.close(parent.layer.getFrameIndex(window.name));
}


</script>
</html>